package com.ccc.boot.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ccc.boot.pojo.UserVO;
import com.ccc.boot.system.entity.SysUser;
import com.ccc.boot.system.pojo.SysUserData;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysUserMapper extends BaseMapper<SysUser> {

    List<UserVO> getEnabledUsers(@Param("query") UserVO query);

    IPage<UserVO> pageUsersByRole(Page<UserVO> page,
                                  @Param("statusEnabled") Integer statusEnabled,
                                  @Param("roleId") Long roleId);

    IPage<UserVO> pageUser(Page<UserVO> page,
                                @Param(Constants.WRAPPER) QueryWrapper<UserVO> wrapper);

    SysUser getUserInfo(@Param("username") String username);

    int countUser(@Param("photoId") Long photoId);
}
